Skip to content

Conversation

@hkosim
Copy link
Contributor

@hkosim hkosim commented Dec 22, 2025

This PR fixes #1653

Implemented changes:

  • getVersion() and getEdition() for Docker as well as kubectl is now working properly on Windows and Linux.

Note:

  • The functionalities has been tested on Windows and Linux using Hyper-V.
  • The used commands to check Docker Desktop version are:
OS Exec. Details Full Commands
Windows cmd through reg and checks for installation in windows registry reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Docker Desktop" /v DisplayVersion
Linux bash through apt and filtered using grep apt list --installed | grep docker-desktop | awk '{print $2}'
  • There are however some alternatives using different Terminals that could be used if the above implemented version are not working as intended.
OS Exec. Details Full Commands
Windows powershell Get-CimInstance Get-CimInstance -ClassName CIM_DataFile -Filter "Name='C:\Program Files\Docker\Docker\Docker Desktop.exe'"
Linux dpkg debian package dpkg -l | grep docker-desktop | awk '{print $3}'
MacOS (Not yet tested) brew Homebrew - additional package manager for MacOS brew list --cask docker --versions | awk '{print $2}'

Pseudocode:

FUNCTION getInstalledVersion():

IF isRancherDesktopInstalled() THEN
        RETURN getRancherDesktopClientVersion()
    ELSE
        osType ← context.getSystemInfo().getOs()

        SWITCH osType
            CASE WINDOWS:
                parsedVersion ← getDockerDesktopVersionWindows()
            CASE LINUX:
                parsedVersion ← getDockerDesktopVersionLinux()
            DEFAULT:
                parsedVersion ← null
        END SWITCH

        IF parsedVersion IS null THEN
            context.error("Couldn't get installed version of " + getName())
        END IF

        RETURN parsedVersion
    END IF
END FUNCTION

FUNCTION getInstalledEdition():

    IF NOT isDockerInstalled() THEN
        context.error("Couldn't get installed edition of " + getName())
        RETURN null
    END IF

    IF isRancherDesktopInstalled() THEN
        RETURN "rancher"
    ELSE
        RETURN "desktop"
    END IF
END FUNCTION

Findings about Testcases

Testcases was not yet implemented correctly. The idea that has been tested:

What could work:

  1. Setting up DockerTest.java with path for mocked rdctl and bash path* on custom environment.properties (*hard-coded) .
    -> getVersion() is working properly.

Still in progress:
Mocking cmd and reg for checking DockerDesktop version.

  • mocking windows executable requires custom or external tools
  • Not yet tested: reg might also be mocked with file with .cmd extension.

Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summarizes what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labeled
    with internal

@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Dec 22, 2025
@hkosim hkosim requested a review from hohwille December 22, 2025 13:31
@hkosim hkosim moved this from 🆕 New to 🏗 In progress in IDEasy board Dec 22, 2025
@coveralls
Copy link
Collaborator

coveralls commented Dec 22, 2025

Pull Request Test Coverage Report for Build 20716812541

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 84 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.2%) to 69.912%

Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/tool/kubectl/KubeCtl.java 5 30.0%
com/devonfw/tools/ide/tool/ToolCommandlet.java 35 74.5%
com/devonfw/tools/ide/tool/docker/Docker.java 44 4.76%
Totals Coverage Status
Change from base Build 20341999990: -0.2%
Covered Lines: 10192
Relevant Lines: 14002

💛 - Coveralls

@hkosim hkosim self-assigned this Jan 5, 2026
@hohwille hohwille self-assigned this Jan 5, 2026
@hohwille hohwille moved this from 🏗 In progress to Team Review in IDEasy board Jan 5, 2026
@hohwille hohwille added this to the release:2026.01.001 milestone Jan 5, 2026
Copy link
Member

@hohwille hohwille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hkosim thank you very much for your PR. You did solid analysis, testing and fixing of the problem. Your code looks good. 👍
I will merge after accepting the suggestions. I will also do polishing and adding a test after the merge in a separate PR to get this merged.

@github-project-automation github-project-automation bot moved this from Team Review to 👀 In review in IDEasy board Jan 6, 2026
@hohwille
Copy link
Member

hohwille commented Jan 6, 2026

[ERROR] Non-resolvable parent POM for com.devonfw.tools.IDEasy.dev:ide:dev-SNAPSHOT: The following artifacts could not be resolved: com.devonfw:maven-parent:pom:14 (absent): Could not transfer artifact com.devonfw:maven-parent:pom:14 from/to central (https://repo.maven.apache.org/maven2): status code: 403, reason phrase: Forbidden (403) and 'parent.relativePath' points at wrong local POM @ line 6, column 11 -> [Help 2]

Wow. CI is unable to download public artifact from maven central and gets 403...
https://repo.maven.apache.org/maven2/com/devonfw/maven-parent/14/maven-parent-14.pom

What is wrong here and why now? Temporary bug of maven central?

@hohwille
Copy link
Member

hohwille commented Jan 6, 2026

Error seems currently reproducible (I restarted the build and it failed with the same error).
This PR does not change any pom.xml or related configs so this does not make any sense at all.
The nightly build is green so it can download the maven-parent POM.
I do not understand how this is possible.

@hohwille
Copy link
Member

hohwille commented Jan 6, 2026

I deleted the maven-parent 14 pom in my local repo and rebuild IDEasy with maven:

[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/com/devonfw/maven-parent/14/maven-parent-14.pom
Downloaded from central: https://repo.maven.apache.org/maven2/com/devonfw/maven-parent/14/maven-parent-14.pom (18 kB at 62 kB/s)

So the download of the POM works.
Do the credentials that we need for the upload to centra.portal somehow interfere here on downloads from central?

@hohwille
Copy link
Member

hohwille commented Jan 6, 2026

So the download of the POM works. Do the credentials that we need for the upload to centra.portal somehow interfere here on downloads from central?

<id>repository</id>

So the credentials only apply for servers with id repository and IMHO the default maven download has id central.
Still does not make any sense at all.

@hohwille
Copy link
Member

hohwille commented Jan 6, 2026

I triggered a build in PR #1650 and it was green so it is not a general maven download issue in CI.
Now, I updated PR #1650 with main and then the build turned red.
So the error is caused by something that is already on main.
However, the nightly build on main was green what still does not make sense to me then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

Implementation of get-version and get-edition commands for Docker

3 participants